import { createRouter, createWebHistory } from 'vue-router'
import search from '@/views/search/index.vue'
import main from '@/views/main/index.vue'

import home from '@/views/main/children/home.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      redirect: 'main/home',
    },
    {
      path: '/search',
      name: 'search',
      component: search,
    },
    {
      path: '/main',
      name: 'main',
      component: main,
      children: [
        {
          path: 'home',
          name: 'home',
          component: home,
        },
      ]
    },
    // {
    //   path: '/about',
    //   name: 'about',
    //   // route level code-splitting
    //   // this generates a separate chunk (About.[hash].js) for this route
    //   // which is lazy-loaded when the route is visited.
    //   component: () => import('../views/AboutView.vue'),
    // },
  ],
})

export default router
